package inference;

import probability.GaussianDistribution;
import probability.ProbabilityDistribution;
import basics.VectorMatrix;

public class GraphVariable extends GraphNode {

	private BeliefMessage _m = null;

	public GraphVariable(String vName) {
		super(vName);
		_m = new BeliefMessage();
	}

@Override
	public BeliefMessage toCached(GraphNode next) {
		return innerTo(next, true, null);
	}

	@Override
	public BeliefMessage toCached(GraphNode next, String opt) {
		return innerTo(next, true, opt);
	}

	@Override
	public BeliefMessage to(GraphNode next, String opt) {
		return innerTo(next, false, opt);
	}

	@Override
	public BeliefMessage to(GraphNode next) {
		return to(next, null);
	}

	
	public ProbabilityDistribution marginal() {
		return toCached(null).getDistribution();
	}

	
}
